/*
 * @Author: jiu yin
 * @Date: 2023-05-15 14:50:04
 * @LastEditTime: 2024-01-02 11:30:48
 * @LastEditors: jiu yin zhen jing
 * @FilePath: \association-service-web-admin\src\redux\modules\current_steps.ts
 * jiu
 */
import { createSlice, createAsyncThunk } from "@reduxjs/toolkit";
import type { PayloadAction } from "@reduxjs/toolkit";

const initialStateInfo= {current_steps:0,current_obj:{}}

export const current_steps = createSlice({
   name: "current_steps",
   initialState:initialStateInfo,
   reducers: {
      set_current_steps: (state, action: PayloadAction<number>) => {
         state.current_steps  = action.payload;
      },
      set_current_obj: (state, action: PayloadAction<object>) => {
         state.current_obj  = { ...state.current_obj,...action.payload};        
      },
      set_current_obj_reset: (state,) => initialStateInfo
   },
});

// Action creators are generated for each case reducer function
export const { set_current_steps,set_current_obj ,set_current_obj_reset} = current_steps.actions;

export default current_steps.reducer;
